x11: Handle obsolete selection requests without crashing
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Nov 2014 03:25:36 +0000 (22:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 27 Nov 2014 03:27:49 +0000 (22:27 -0500)
The ICCCM says:

If the specified property is None , the requestor is an obsolete client.
Owners are encouraged to support these clients by using the specified
target atom as the property name to be used for the reply.

Lets do that, instead of crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=740613

gdk/x11/gdkdisplay-x11.c

index 89c2b7df746d49e4ec7af47e6be91da0401ad0df..e658780994851b644cd1d4555712c07150338b6b 100644 (file)
@@ -939,7 +939,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
       event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.selection);
       event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.target);
       if (xevent->xselection.property == None)
-        event->selection.property = GDK_NONE;
+        event->selection.property = event->selection.target;
       else
         event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property);
       event->selection.time = xevent->xselection.time;